package com.ittest.utils;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;



//作为springmvc的异常处理器
@RestControllerAdvice
public class projectExceptionAdvice {


    //拦截所有的异常信息
    @ExceptionHandler(Exception.class)
    public R doException(Exception ex){
        //记录日志

        //通知开发
        ex.printStackTrace();
        return new R("出现故障了。。。");
    }

}
